package com.lxb;

public class DeleteDuplicates {
    public static void main(String[] args) {

        ListNode head = new ListNode(1);

        ListNode first = new ListNode(1);
        head.next = first;

        ListNode second = new ListNode(1);
        first.next = second;

       /* ListNode third = new ListNode(3);
        second.next = third;

        ListNode forth = new ListNode(3);
        third.next = forth;*/

        ListNode cur = head;

//        if(head == null)
//            return head;

        while(cur.next != null){
            if (cur.val == cur.next.val){
                cur.next = cur.next.next;
            }else{
                cur = cur.next;
            }

        }


        while (head != null){
            System.out.println(head.val);
            head = head.next;
        }


    }
}


